package wb.is.besti.edu.cn.helloworld;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.View;

/**
 * Created by asus on 2017/5/25.
 */

public class Clock extends AppCompatActivity {
    int counter=0;
    int[] color={Color.BLACK,Color.BLUE,Color.CYAN,Color.DKGRAY,Color.GRAY,Color.GREEN,Color.LTGRAY,Color.MAGENTA,Color.RED,Color.WHITE,Color.YELLOW};
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.clock);
    }
    public void changeColor(View view){
        if(counter == color.length){
            counter=0;
        }
        view.setBackgroundColor(color[counter++]);
    }
}
